package com.xjgzinfo.usdp.service.dto;

import com.xjgzinfo.usdp.jpa.service.Criteria;
import com.xjgzinfo.usdp.jpa.service.filter.Filter;
import com.xjgzinfo.usdp.jpa.service.filter.IntegerFilter;
import com.xjgzinfo.usdp.jpa.service.filter.LongFilter;
import com.xjgzinfo.usdp.jpa.service.filter.StringFilter;

import java.io.Serializable;
import java.util.Objects;

/**
 * Criteria class for the {@link com.xjgzinfo.usdp.domain.BladeVisualRecord} entity. This class is used
 * in {@link com.xjgzinfo.usdp.web.rest.BladeVisualRecordResource} to receive all the possible filtering options from
 * the Http GET request parameters.
 * For example the following could be a valid request:
 * {@code /blade-visual-records?id.greaterThan=5&attr1.contains=something&attr2.specified=false}
 * As Spring is unable to properly convert the types, unless specific {@link Filter} class are used, we need to use
 * fix type specific filters.
 */
public class BladeVisualRecordCriteria implements Serializable, Criteria {

    private static final long serialVersionUID = 1L;

    private LongFilter id;

    private StringFilter name;

    private StringFilter url;

    private IntegerFilter dataType;

    private StringFilter dataMethod;

    private StringFilter dataHeader;

    private StringFilter dataQuery;

    private StringFilter dataQueryType;

    private StringFilter wsUrl;

    private IntegerFilter isDeleted;

    public BladeVisualRecordCriteria() {
    }

    public BladeVisualRecordCriteria(BladeVisualRecordCriteria other) {
        this.id = other.id == null ? null : other.id.copy();
        this.name = other.name == null ? null : other.name.copy();
        this.url = other.url == null ? null : other.url.copy();
        this.dataType = other.dataType == null ? null : other.dataType.copy();
        this.dataMethod = other.dataMethod == null ? null : other.dataMethod.copy();
        this.dataHeader = other.dataHeader == null ? null : other.dataHeader.copy();
        this.dataQuery = other.dataQuery == null ? null : other.dataQuery.copy();
        this.dataQueryType = other.dataQueryType == null ? null : other.dataQueryType.copy();
        this.wsUrl = other.wsUrl == null ? null : other.wsUrl.copy();
        this.isDeleted = other.isDeleted == null ? null : other.isDeleted.copy();
    }

    @Override
    public BladeVisualRecordCriteria copy() {
        return new BladeVisualRecordCriteria(this);
    }

    public LongFilter getId() {
        return id;
    }

    public void setId(LongFilter id) {
        this.id = id;
    }

    public StringFilter getName() {
        return name;
    }

    public void setName(StringFilter name) {
        this.name = name;
    }

    public StringFilter getUrl() {
        return url;
    }

    public void setUrl(StringFilter url) {
        this.url = url;
    }

    public IntegerFilter getDataType() {
        return dataType;
    }

    public void setDataType(IntegerFilter dataType) {
        this.dataType = dataType;
    }

    public StringFilter getDataMethod() {
        return dataMethod;
    }

    public void setDataMethod(StringFilter dataMethod) {
        this.dataMethod = dataMethod;
    }

    public StringFilter getDataHeader() {
        return dataHeader;
    }

    public void setDataHeader(StringFilter dataHeader) {
        this.dataHeader = dataHeader;
    }

    public StringFilter getDataQuery() {
        return dataQuery;
    }

    public void setDataQuery(StringFilter dataQuery) {
        this.dataQuery = dataQuery;
    }

    public StringFilter getDataQueryType() {
        return dataQueryType;
    }

    public void setDataQueryType(StringFilter dataQueryType) {
        this.dataQueryType = dataQueryType;
    }

    public StringFilter getWsUrl() {
        return wsUrl;
    }

    public void setWsUrl(StringFilter wsUrl) {
        this.wsUrl = wsUrl;
    }

    public IntegerFilter getIsDeleted() {
        return isDeleted;
    }

    public void setIsDeleted(IntegerFilter isDeleted) {
        this.isDeleted = isDeleted;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        final BladeVisualRecordCriteria that = (BladeVisualRecordCriteria) o;
        return
                Objects.equals(id, that.id) &&
                        Objects.equals(name, that.name) &&
                        Objects.equals(url, that.url) &&
                        Objects.equals(dataType, that.dataType) &&
                        Objects.equals(dataMethod, that.dataMethod) &&
                        Objects.equals(dataHeader, that.dataHeader) &&
                        Objects.equals(dataQuery, that.dataQuery) &&
                        Objects.equals(dataQueryType, that.dataQueryType) &&
                        Objects.equals(wsUrl, that.wsUrl) &&
                        Objects.equals(isDeleted, that.isDeleted);
    }

    @Override
    public int hashCode() {
        return Objects.hash(
                id,
                name,
                url,
                dataType,
                dataMethod,
                dataHeader,
                dataQuery,
                dataQueryType,
                wsUrl,
                isDeleted
        );
    }

    @Override
    public String toString() {
        return "BladeVisualRecordCriteria{" +
                "id=" + id +
                ", name=" + name +
                ", url=" + url +
                ", dataType=" + dataType +
                ", dataMethod=" + dataMethod +
                ", dataHeader=" + dataHeader +
                ", dataQuery=" + dataQuery +
                ", dataQueryType=" + dataQueryType +
                ", wsUrl=" + wsUrl +
                ", isDeleted=" + isDeleted +
                '}';
    }

}
